import React from 'react';
import {NavBar} from 'antd-mobile';
import './GoodsTGPage.scss';

/**
 * 商品推广页面
 */
export class GoodsTGPage extends React.Component {

  constructor(props) {
    super(props)
    this.state = {
      bannerWidth: 0
    }
  }

  componentDidMount() {
    const width = document.documentElement.clientWidth;
    this.setState({
      bannerWidth: width
    });
  }

  render() {
    // console.log(this.props);
    const {bannerWidth} = this.state;
    const {location, history} = this.props;
    return (
      <div>
        <div className={"tab-header"}>
          <NavBar
            mode="light"
            icon={<img src={require('../assets/jrsx/back.svg')} width={22} height={22} alt=""/>}
            onLeftClick={() => {
              let from = '';
              if (!location.state) {
                from = '/index/faxian';
              } else {
                from = location.state.from;
              }
              history.push(from);
            }}
          >宝贝推广信息</NavBar>
        </div>
        <div className="goods_tg_img" style={{height: bannerWidth / 8 * 7}}>
          <img
            src={require(`../assets/goods1.jpg`)}
            alt=""
            style={{width: bannerWidth}}
          />
        </div>

        <div className="goods_tg_contaniner">

        </div>
        <div className="goods_tg_share">
          立即分享
        </div>
      </div>
    )
  }
}
